// import { SCHEDULE_STATUS } from './constants';

export interface IStudent {
  id: string;
  tel: string;
  name: string;
  avatar: string;
  openid: string;
}

export interface IPage {
  pageNum: number;
  pageSize: number;
  total: number;
}

export interface IPropChild {
  children: React.ReactNode;
}

export interface IProductType {
  key: string;
  title: string;
}

/**
 * 图片
 */
export interface IImage {
  id: number;
  url: string;
  remark:string;
}

export interface IMedia {
  id: string;
  url: string;
  remark: string;
}

// /**
//  * 门店
//  */
export interface IOrganization {
  id: string;
  //   orgFrontImg?: IMedia[];
  //   orgRoomImg?: IMedia[];
  //   orgOtherImg?: IMedia[];
  name: string;
  logo?: string;
  tags?: string;
  description?: string;
  address?: string;
  tel?: string;
  longitude?: string;
  latitude?: string;
  identityCardBackImg?:string
  identityCardFrontImg?:string
  businessLicense?:string
}

// /**
//  * 课程
//  */
export interface ICourse {

  /**
   * 课程id
   */
  id: string;
  /**
   * 课程名称
   */
  name: string;
  /**
   * 课程描述
   */
  desc?: string;
  /**
   * 适龄人群
   */
  group?: string;
  /**
   * 适合基础
   */
  baseAbility?: string;
  /**
   * 限制上课人数
   */
  limitNumber?: number;
  /**
   * 持续时间
   */
  duration?: number;
  /**
   * 预约信息
   */
  reserveInfo?: string;
  /**
   * 退款信息
   */
  refundInfo?: string;
  /**
   * 其他说明信息
   */
  otherInfo?: string;

}

export interface ICard {
  id?: string,
  name: string,
  type: string;
  time: number;
  validityDay: number;
  course: ICourse;
}

// /**
//  * 商品
//  */
export interface IProduct {
  id?: string, // id
  name: string; // 商品名称
  desc: string; // 商品描述
  stock: number; // 库存总数
  curStock: number; // 当前库存
  buyNumber: number; // 销量
  limitBuyNumber: number; // 限购数量
  coverUrl: string; // 封面图
  bannerUrl: string; // 头部banner图
  originalPrice: number; // 原价
  preferentialPrice: number; // 优惠价
  status: string; // 上架状态
  distance: string; // 距离
  org: IOrganization // 门店信息
  tel: string; // 手机号
  cards: ICard[];
}

type TBaseQuery<T> = { [key: string]: { __typename?: 'Query', data: T, page: IPage } };
// export type TProductTypeQuery = TBaseQuery<IProductType[]>;
// export type TProductsQuery = TBaseQuery<IProduct[]>;
// export type TOrgQuerySingle = TBaseQuery<IOrganization>;
// export type TProductQuery = TBaseQuery<IProduct>;

export type TOrgQuery = TBaseQuery<IOrganization>;

export type TCourse = ICourse & { cardName:string };

export interface IWxConfig {
  appId: string;
  timeStamp: string;
  nonceStr: string;
  package: string;
  signType: string;
  paySign: string;
}

export type TWxConfigQuery = TBaseQuery<IWxConfig>;

// /**
//  * 个人消费卡
//  */
// export interface ICardRecord {
//   id:string
//   startTime:string
//   endTime:string
//   buyTime:string
//   residueTime:number;  //剩余次数
//   status:string
//   card:ICard
//   org:IOrganization
// }

// export interface ITeacher {
//     id: string;
//     name: string;
//     photoUrl: string;
// }

// // 课程表
// export interface ISchedule {
//     id: string;
//     startTime: string;
//     endTime: string;
//     buyTime: string;
//     schoolDay: string;//上课日期
//     course: ICourse;
//     teacher: ITeacher;
// }

// export interface IScheduleRecord{
//     id: string;
//     subscribeTime: string;
//     tel: string;
//     status: keyof typeof SCHEDULE_STATUS;
//     course: ICourse;
//     student: IStudent;
//     schedule: ISchedule;
//     org:IOrganization;
// }

// export type TSchedulesQuery = TBaseQuery<ISchedule[]>;
// export type TWxConfigQuery = TBaseQuery<ISchedule[]>;

// export type TCardRecordsQuery = TBaseQuery<ICardRecord[]>;
// export type TScheduleRecordsQuery = TBaseQuery<IScheduleRecord[]>;

// export type ICardRecordQuery = TBaseQuery<ICardRecord[]>;
